package com.joinway.admin.bean.view;

import java.util.List;

import org.springframework.util.StringUtils;

import com.joinway.framework.bean.BaseBean;
import com.joinway.platform.bean.RadioItem;

public class Ddl2CodeColumn extends BaseBean {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	String name;
	
	String uname;
	
	/**
	 * java type
	 */
	String type;
	
	String utype;
	
	String equal;

	String like;
	
	/**
	 * data type
	 */
	String category;
	
	boolean id;
	
	/**
	 * whether it is a query column
	 */
	boolean query;
	
	/**
	 * whether it is a required field when update
	 */
	boolean required;
	
	/**
	 * human readable name
	 */
	String text;
	
	/**
	 * if editable, it will displayed on edit layer, else not
	 */
	boolean editable = false;
	
	/**
	 * min number
	 */
	String min;
	
	/**
	 * max number
	 */
	String max;
	
	/**
	 * decimal precision
	 */
	String precision;
	
	/**
	 * value list
	 */
	List<RadioItem> list;

	/**
	 * whether the column is visible or not
	 */
	boolean visible;
	
	String comment;
	
	public Ddl2CodeColumn(){}
	
	public Ddl2CodeColumn(String name, String type) {
		this.name = name;
		this.type = type;
		this.uname = StringUtils.capitalize(name);
		this.utype = StringUtils.capitalize(type);
	}
	
	public Ddl2CodeColumn(String name, String type, String equal, String like) {
		this(name, type);
		this.equal = equal;
		this.like = like;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
		this.uname = StringUtils.capitalize(name);
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
		utype = StringUtils.capitalize(type);
	}

	public String getUtype() {
		return utype;
	}

	public void setUtype(String utype) {
		this.utype = utype;
	}

	public String getEqual() {
		return equal;
	}

	public void setEqual(String equal) {
		this.equal = equal;
	}

	public String getLike() {
		return like;
	}

	public void setLike(String like) {
		this.like = like;
	}

	public boolean isId() {
		return id;
	}

	public void setId(boolean id) {
		this.id = id;
	}

	public String getCategory() {
		return category;
	}

	public void setCategory(String category) {
		this.category = category;
	}

	public boolean isQuery() {
		return query;
	}

	public void setQuery(boolean query) {
		this.query = query;
	}

	public boolean isRequired() {
		return required;
	}

	public void setRequired(boolean required) {
		this.required = required;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	public boolean isEditable() {
		return editable;
	}

	public void setEditable(boolean editable) {
		this.editable = editable;
	}

	public String getMin() {
		return min;
	}

	public void setMin(String min) {
		this.min = min;
	}

	public String getMax() {
		return max;
	}

	public void setMax(String max) {
		this.max = max;
	}

	public String getPrecision() {
		return precision;
	}

	public void setPrecision(String precision) {
		this.precision = precision;
	}

	public List<RadioItem> getList() {
		return list;
	}

	public void setList(List<RadioItem> list) {
		this.list = list;
	}

	public boolean isVisible() {
		return visible;
	}

	public void setVisible(boolean visible) {
		this.visible = visible;
	}

	public String getUname() {
		return uname;
	}

	public void setUname(String uname) {
		this.uname = uname;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}
	
}
